<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/workbusiness/upper_work_order.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/system/workbusiness/upper_work_order.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'work_order_id',
                footer: "Foots",
                cnName: '工单',
                name: 'workbusiness/upper_work_order',
                url: "/upper_work_order/",
                sortName: "work_order_id"
            });
            const editFormFields = ref({"work_order_number":"","workpiece_id":"","priority":"","material_id":"","processing_grade":"","length":"","width":"","height":"","measure_number":"","centring_number":"","make_level_number":"","accuracy":""});
            const editFormOptions = ref([[{"title":"工单编号主键","field":"work_order_number"},
                               {"title":"工件","field":"workpiece_id","disabled":true,"type":"number"},
                               {"title":"优先等级","field":"priority","type":"number"}],
                              [{"title":"材料表","field":"material_id","type":"number"},
                               {"title":"加工等级","required":true,"field":"processing_grade","type":"number"}],
                              [{"title":"长度","field":"length","type":"decimal"},
                               {"title":"宽度","field":"width","type":"decimal"},
                               {"title":"高度","field":"height","type":"decimal"}],
                              [{"title":"打表程序名","field":"measure_number","placeholder":"DB开头"},
                               {"title":"分中程序名","field":"centring_number","placeholder":'FZ开头'},
                               {"title":"放平程序名","field":"make_level_number","placeholder":"FP开头"}],
                              [
                                {"title":"精度","field":"accuracy","type":"decimal"},
                                {"title":"状态","field":"process_Status","type":"int",placeholder:"0:未开始，1：加工中，2：已完成"}
                              ]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'work_order_id',title:'主键',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'work_order_number',title:'工单',type:'string',width:220,align:'left',sort:true},
                       {field:'workpiece_id',title:'工件',type:'int',width:110,hidden:true,readonly:true,align:'left'},
                       {field:'priority',title:'优先等级',type:'int',width:110,align:'left'},
                       {field:'material_id',title:'材料表',type:'int',width:110,align:'left'},
                       {field:'processing_grade',title:'加工等级',type:'int',width:110,require:true,align:'left'},
                       {field:'length',title:'长度',type:'decimal',width:110,align:'left'},
                       {field:'width',title:'宽度',type:'decimal',width:110,align:'left'},
                       {field:'height',title:'高度',type:'decimal',width:110,align:'left'},
                       {field:'measure_number',title:'打表程序名-DB',type:'button',width:120,align:'left'},
                       {field:'centring_number',title:'分中程序名-FZ',type:'button',width:120,align:'left'},
                       {field:'make_level_number',title:'放平程序名-FP',type:'button',width:120,align:'left'},
                       {field:'accuracy',title:'精度',type:'decimal',width:120,align:'left'},
                       {field:'process_Status',title:'状态',type:'int',bind:{ key:'工单加工状态',data:[]},width:110,require:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
